
from pprint import pprint
from conn_mysql import ConnectMysql


# carpooling_Hitl = 0
# direction = 0

# sql = "SELECT * FROM call_car WHERE carpooling_Hitl=%s AND direction=%s ORDER BY go_time DESC"
# sql_ = "SELECT * FROM order_status WHERE order_id=%s"

# with ConnectMysql() as c:

#     result = c.select_all(sql, (carpooling_Hitl, direction))

    
#     for i in result:

#         i['order_status'] = c.select_one(sql_,(i['id']))['order_status']

# print(result)

join_sql = """
    SELECT 
    -- 从两张表中取字段
    call_car.go_time, call_car.phone, order_status.order_status
    FROM 
    (call_car JOIN order_status);
"""

with ConnectMysql() as c:

    join_result = c.select_all(join_sql)

pprint(join_result)